class Model
	def initialize
		@figurArray = Array.new
	end
	def nyFigur(figur)
		@figurArray << figur
	end
	def getFigur(num)
		@figurArray[num]
	end
	def getAntalFigurer
		@figurArray.length
	end
end

$model = Model.new
=begin
class Samler
	attr_reader :figurer
	attr_writer :figurer
	def initialize
		@figurer = Array.new
	end
	def +(figur)
		samler = Samler.new()
		samler.figurer << self.figurer
		if(figur.kind_of? Figur)
			samler.figurer << figur
		elsif (figur.kind_of? Samler)
			samler.figurer << figur.figurer
		end
		samler
	end
end
=end
class Figur
	attr_reader :x, :y, :billede
	attr_writer :x, :y, :billede
	def initialize
		$model.nyFigur(self)
	end
=begin
	def +(figur)
		samler = Samler.new()
		samler.figurer << self
		if(figur.kind_of? Figur)
			samler.figurer << figur
		elsif (figur.kind_of? Samler)
			samler.figurer << figur.figurer
		end
		samler
	end
=end
end

class Mand < Figur
	def initialize
		super
		self.x=100
		self.y=100
		self.billede="test"
	end
	def GaaTil(x, y)
		if x < self.x
			self.x = (self.x - 1)
		elsif x > self.x
			self.x = (self.x + 1)
		end
		if y < self.y
			self.y = (self.y - 1)
		elsif y > self.y
			self.y = (self.y + 1)
		end
		(self.y == y && self.x == x)
	end
=begin
=end
end

$Pause_running = false

def Pause(tid)
#	def self.vent(tid)
	if($Pause_running)
		@@timer-=1;
		if(@@timer <= 1)
			$Pause_running = false
		end
	else
		@@timer = tid
		$Pause_running = true
	end
	!$Pause_running
#	end
end